import { lazy } from 'react'

export const indexRoutes = [
  {
    path: '/article',
    meta: {
      title: 'article'
    },
    element: lazy(() => import('@/pages/index/article/article'))
  },
  {
    path: '/archives',
    meta: {
      title: 'Archives'
    },
    element: lazy(() => import('@/pages/index/archives/archives'))
  },
  {
    path: '/konwIedge',
    meta: {
      title: 'konwIedge'
    },
    element: lazy(() => import('@/pages/index/konwIedge/konwIedge'))
  }
]

// 定义路由表
const routes = {
  // 设置模式
  mode: 'hash',
  //
  routes: [
    {
      path: '/',
      element: lazy(() => import('@/pages/index/index')),
      children: [
        ...indexRoutes,
        {
          path: '/',
          to: '/article'
        }
      ]
    },
    {
      path: '/*',
      element: lazy(() => import('@/pages/404'))
    }
  ]
}

export default routes
